<template>
  <div class="new-phone-menu" v-if="menuList && menuList.show == 1">
    <div
      class="new-phone-menu-body"
      v-if="menuList.banner && menuList.banner.length > 0"
    >
      <div
        class="new-phone-menu-item"
        :style="{ width: menuList.style ? 100 / menuList.style + '%' : '20%' }"
        v-for="(item, i) in menuList.banner"
        :key="i"
      >
        <div class="new-phone-menu-item-icon">
          <img
            :src="$fnc.getImgUrl(item.piclink + '?' + new Date().getTime())"
            crossOrigin="anonymous"
            alt
          />
        </div>
        <span>{{ item.title }}</span>
        <img
          v-if="item.desc == 1"
          src="@/assets/img/home/1.gif"
          class="menu-icon-gif"
        />
        <img
          v-else-if="item.desc == 2"
          src="@/assets/img/home/2.gif"
          class="menu-icon-gif"
        />
        <img
          v-else-if="item.desc == 3"
          src="@/assets/img/home/3.gif"
          class="menu-icon-gif"
        />
      </div>
    </div>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  data() {
    return {};
  },
  components: {},
  computed: {
    ...mapState({
      menuList: (state) => state.modulePage.data.menu,
    }),
  },
  created() {},
  mounted() {},
  methods: {},
};
</script>

<style scoped lang="less">
.new-phone-menu {
  width: 94%;
  min-height: 75px;
  margin: 0 auto 0 auto;
  background-color: #fff;
  border-radius: 5px;
  height: auto;
  z-index: 10;
  padding: 0;
  position: relative;
  .new-phone-menu-body {
    height: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    .new-phone-menu-item {
      width: 20%;
      height: 70px;
      display: flex;
      flex-flow: column;
      justify-content: center;
      align-items: center;
      padding-top: 10px;
      cursor: pointer;
      position: relative;
      > span {
        font-size: 12px;
        color: #333333;
        padding-bottom: 5px;
      }
      .new-phone-menu-item-icon {
        height: 60%;
        img {
          height: 100%;
        }
      }

      .menu-icon-gif {
        position: absolute;
        top: 0;
        right: 8px;
        width: 30px;
      }
    }
  }
}
</style>
